{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 数据来源：某企业销售的6种商品所对应的送货及用户反馈数据\n",
    "### 解决问题：\n",
    "##### 1、配送服务是否存在问题\n",
    "##### 2、是否存在尚有潜力的销售区域\n",
    "##### 3、商品是否存在质量问题\n",
    "\n",
    "### 先放结论：\n",
    "##### 1、货品4→西北，货品2→马来西亚两条线路存在较大问题，急需提升时效\n",
    "##### 2、货品2在华东地区还有较大市场空间，适合加大投入，同时货品2在西北配送时效长，用户拒收率高，从成本角度考虑，应该减少投入\n",
    "##### 3、货品1、2、4质量存在问题，建议扩大抽检范围，增大质检力度\n",
    "\n",
    "### 分析过程如下\n",
    "#### 一、数据清洗\n",
    "##### ① 重复值、缺失值、格式调整\n",
    "##### ② 异常值处理（比如：销售金额存在等于0的，数量和销售金额的标准差都在均值的8倍以上等）\n",
    "#### 二、数据规整\n",
    "##### 比如：增加一项辅助列：月份\n",
    "#### 三、数据分析并可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt \n",
    "plt.rcParams['font.sans-serif'] = 'SimHei' ## 设置中文显示"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 一、数据清洗\n",
    "① 重复值、缺失值、格式调整"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 1161 entries, 0 to 1160\n",
      "Data columns (total 10 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   订单号     1159 non-null   object \n",
      " 1   订单行     1161 non-null   int64  \n",
      " 2   销售时间    1161 non-null   object \n",
      " 3   交货时间    1161 non-null   object \n",
      " 4   货品交货状况  1159 non-null   object \n",
      " 5   货品      1161 non-null   object \n",
      " 6   货品用户反馈  1161 non-null   object \n",
      " 7   销售区域    1161 non-null   object \n",
      " 8   数量      1157 non-null   float64\n",
      " 9   销售金额    1161 non-null   object \n",
      "dtypes: float64(1), int64(1), object(8)\n",
      "memory usage: 90.8+ KB\n"
     ]
    }
   ],
   "source": [
    "data = pd.read_csv('data_wuliu.csv',encoding='gbk')\n",
    "data.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 通过info()可以看出，包括10列数据，名字，数据量，格式等，可以得出：\n",
    "#### 1.订单号，货品交货情况，数量：存在缺失值，但是确实量不大，可以删除\n",
    "#### 2.订单行，对分析无关紧要，可以考虑删除\n",
    "#### 3.销售金额格式不对（万元|元，逗号问题）,数据类型需要转换成int|float"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Index: 1146 entries, 0 to 1160\n",
      "Data columns (total 9 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   订单号     1146 non-null   object \n",
      " 1   销售时间    1146 non-null   object \n",
      " 2   交货时间    1146 non-null   object \n",
      " 3   货品交货状况  1146 non-null   object \n",
      " 4   货品      1146 non-null   object \n",
      " 5   货品用户反馈  1146 non-null   object \n",
      " 6   销售区域    1146 non-null   object \n",
      " 7   数量      1146 non-null   float64\n",
      " 8   销售金额    1146 non-null   object \n",
      "dtypes: float64(1), object(8)\n",
      "memory usage: 89.5+ KB\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "#删除重复记录\n",
    "data.drop_duplicates(keep='first',inplace=True)\n",
    "#删除缺失值（na,删除待有na的整行数据,axis=0,how='any'默认值）\n",
    "data.dropna(axis=0,how='any',inplace=True)\n",
    "#删除订单行(重复运行会报错，因为第一次已经删除了订单行这一列)\n",
    "data.drop(columns=['订单行'],inplace=True,axis=1)\n",
    "print(data.info())\n",
    "#更新索引(drop=True:把原来的索引index列删除，重置index)\n",
    "data.reset_index(drop=True,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "#取出销售金额列，对每一个数据进行清洗\n",
    "#编写自定义过滤函数：删除逗号，转成float，如果是万元则*10000，否则，删除元"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>订单号</th>\n",
       "      <th>销售时间</th>\n",
       "      <th>交货时间</th>\n",
       "      <th>货品交货状况</th>\n",
       "      <th>货品</th>\n",
       "      <th>货品用户反馈</th>\n",
       "      <th>销售区域</th>\n",
       "      <th>数量</th>\n",
       "      <th>销售金额</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>P096311</td>\n",
       "      <td>2016-7-30</td>\n",
       "      <td>2016-9-30</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>2.0</td>\n",
       "      <td>105275.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>P096826</td>\n",
       "      <td>2016-8-30</td>\n",
       "      <td>2016-10-30</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>10.0</td>\n",
       "      <td>11500000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>P097435</td>\n",
       "      <td>2016-7-30</td>\n",
       "      <td>2016-9-30</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品1</td>\n",
       "      <td>返修</td>\n",
       "      <td>华南</td>\n",
       "      <td>2.0</td>\n",
       "      <td>685877.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>P097446</td>\n",
       "      <td>2016-11-26</td>\n",
       "      <td>2017-1-26</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>15.0</td>\n",
       "      <td>12958.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>P097446</td>\n",
       "      <td>2016-11-26</td>\n",
       "      <td>2017-1-26</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>拒货</td>\n",
       "      <td>华北</td>\n",
       "      <td>15.0</td>\n",
       "      <td>3239.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1141</th>\n",
       "      <td>P299901</td>\n",
       "      <td>2016-12-15</td>\n",
       "      <td>2017-3-15</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品6</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>马来西亚</td>\n",
       "      <td>2.0</td>\n",
       "      <td>20041.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1142</th>\n",
       "      <td>P302956</td>\n",
       "      <td>2016-12-22</td>\n",
       "      <td>2017-3-22</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>拒货</td>\n",
       "      <td>华东</td>\n",
       "      <td>20.0</td>\n",
       "      <td>7944.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1143</th>\n",
       "      <td>P303801</td>\n",
       "      <td>2016-12-15</td>\n",
       "      <td>2017-3-15</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华东</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19408.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1144</th>\n",
       "      <td>P307276</td>\n",
       "      <td>2016-12-22</td>\n",
       "      <td>2017-3-22</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品6</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>马来西亚</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3218.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1145</th>\n",
       "      <td>P314165</td>\n",
       "      <td>2016-12-20</td>\n",
       "      <td>2017-3-20</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华东</td>\n",
       "      <td>1.0</td>\n",
       "      <td>172092.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1146 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          订单号        销售时间        交货时间 货品交货状况   货品 货品用户反馈  销售区域    数量  \\\n",
       "0     P096311   2016-7-30   2016-9-30    晚交货  货品3   质量合格    华北   2.0   \n",
       "1     P096826   2016-8-30  2016-10-30   按时交货  货品3   质量合格    华北  10.0   \n",
       "2     P097435   2016-7-30   2016-9-30   按时交货  货品1     返修    华南   2.0   \n",
       "3     P097446  2016-11-26   2017-1-26    晚交货  货品3   质量合格    华北  15.0   \n",
       "4     P097446  2016-11-26   2017-1-26    晚交货  货品3     拒货    华北  15.0   \n",
       "...       ...         ...         ...    ...  ...    ...   ...   ...   \n",
       "1141  P299901  2016-12-15   2017-3-15   按时交货  货品6   质量合格  马来西亚   2.0   \n",
       "1142  P302956  2016-12-22   2017-3-22   按时交货  货品2     拒货    华东  20.0   \n",
       "1143  P303801  2016-12-15   2017-3-15   按时交货  货品2   质量合格    华东   1.0   \n",
       "1144  P307276  2016-12-22   2017-3-22   按时交货  货品6   质量合格  马来西亚   1.0   \n",
       "1145  P314165  2016-12-20   2017-3-20   按时交货  货品2   质量合格    华东   1.0   \n",
       "\n",
       "            销售金额  \n",
       "0       105275.0  \n",
       "1     11500000.0  \n",
       "2       685877.0  \n",
       "3        12958.0  \n",
       "4         3239.0  \n",
       "...          ...  \n",
       "1141     20041.0  \n",
       "1142      7944.0  \n",
       "1143     19408.0  \n",
       "1144      3218.0  \n",
       "1145    172092.0  \n",
       "\n",
       "[1146 rows x 9 columns]"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def data_deal(number):\n",
    "    if number.find('万元')!= -1:#找到带有万元的，取出数字，去掉逗号，转成float，*10000\n",
    "        number_new = float(number[:number.find('万元')].replace(',',''))*10000\n",
    "        pass\n",
    "    else: #找到带有元的，删除元，删除逗号，转成float\n",
    "        number_new = float(number.replace('元','').replace(',',''))\n",
    "        pass\n",
    "    return number_new\n",
    "data['销售金额'] = data['销售金额'].map(data_deal)\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### ② 异常值处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                 数量          销售金额\n",
      "count   1146.000000  1.146000e+03\n",
      "mean      76.069372  1.223488e+05\n",
      "std      589.416486  1.114599e+06\n",
      "min        1.000000  0.000000e+00\n",
      "25%        1.000000  2.941500e+03\n",
      "50%        1.000000  9.476500e+03\n",
      "75%        4.000000  3.576775e+04\n",
      "max    11500.000000  3.270000e+07\n"
     ]
    }
   ],
   "source": [
    "print(data.describe())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1.销售金额为0的情况，删除\n",
    "#### 2.产生严重的数据左偏情况（电商领域的2/8法则很正常。）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>订单号</th>\n",
       "      <th>销售时间</th>\n",
       "      <th>交货时间</th>\n",
       "      <th>货品交货状况</th>\n",
       "      <th>货品</th>\n",
       "      <th>货品用户反馈</th>\n",
       "      <th>销售区域</th>\n",
       "      <th>数量</th>\n",
       "      <th>销售金额</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>P096311</td>\n",
       "      <td>2016-7-30</td>\n",
       "      <td>2016-9-30</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>2.0</td>\n",
       "      <td>105275.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>P096826</td>\n",
       "      <td>2016-8-30</td>\n",
       "      <td>2016-10-30</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>10.0</td>\n",
       "      <td>11500000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>P097435</td>\n",
       "      <td>2016-7-30</td>\n",
       "      <td>2016-9-30</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品1</td>\n",
       "      <td>返修</td>\n",
       "      <td>华南</td>\n",
       "      <td>2.0</td>\n",
       "      <td>685877.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>P097446</td>\n",
       "      <td>2016-11-26</td>\n",
       "      <td>2017-1-26</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>15.0</td>\n",
       "      <td>12958.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>P097446</td>\n",
       "      <td>2016-11-26</td>\n",
       "      <td>2017-1-26</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>拒货</td>\n",
       "      <td>华北</td>\n",
       "      <td>15.0</td>\n",
       "      <td>3239.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1141</th>\n",
       "      <td>P299901</td>\n",
       "      <td>2016-12-15</td>\n",
       "      <td>2017-3-15</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品6</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>马来西亚</td>\n",
       "      <td>2.0</td>\n",
       "      <td>20041.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1142</th>\n",
       "      <td>P302956</td>\n",
       "      <td>2016-12-22</td>\n",
       "      <td>2017-3-22</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>拒货</td>\n",
       "      <td>华东</td>\n",
       "      <td>20.0</td>\n",
       "      <td>7944.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1143</th>\n",
       "      <td>P303801</td>\n",
       "      <td>2016-12-15</td>\n",
       "      <td>2017-3-15</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华东</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19408.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1144</th>\n",
       "      <td>P307276</td>\n",
       "      <td>2016-12-22</td>\n",
       "      <td>2017-3-22</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品6</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>马来西亚</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3218.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1145</th>\n",
       "      <td>P314165</td>\n",
       "      <td>2016-12-20</td>\n",
       "      <td>2017-3-20</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华东</td>\n",
       "      <td>1.0</td>\n",
       "      <td>172092.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1145 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          订单号        销售时间        交货时间 货品交货状况   货品 货品用户反馈  销售区域    数量  \\\n",
       "0     P096311   2016-7-30   2016-9-30    晚交货  货品3   质量合格    华北   2.0   \n",
       "1     P096826   2016-8-30  2016-10-30   按时交货  货品3   质量合格    华北  10.0   \n",
       "2     P097435   2016-7-30   2016-9-30   按时交货  货品1     返修    华南   2.0   \n",
       "3     P097446  2016-11-26   2017-1-26    晚交货  货品3   质量合格    华北  15.0   \n",
       "4     P097446  2016-11-26   2017-1-26    晚交货  货品3     拒货    华北  15.0   \n",
       "...       ...         ...         ...    ...  ...    ...   ...   ...   \n",
       "1141  P299901  2016-12-15   2017-3-15   按时交货  货品6   质量合格  马来西亚   2.0   \n",
       "1142  P302956  2016-12-22   2017-3-22   按时交货  货品2     拒货    华东  20.0   \n",
       "1143  P303801  2016-12-15   2017-3-15   按时交货  货品2   质量合格    华东   1.0   \n",
       "1144  P307276  2016-12-22   2017-3-22   按时交货  货品6   质量合格  马来西亚   1.0   \n",
       "1145  P314165  2016-12-20   2017-3-20   按时交货  货品2   质量合格    华东   1.0   \n",
       "\n",
       "            销售金额  \n",
       "0       105275.0  \n",
       "1     11500000.0  \n",
       "2       685877.0  \n",
       "3        12958.0  \n",
       "4         3239.0  \n",
       "...          ...  \n",
       "1141     20041.0  \n",
       "1142      7944.0  \n",
       "1143     19408.0  \n",
       "1144      3218.0  \n",
       "1145    172092.0  \n",
       "\n",
       "[1145 rows x 9 columns]"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = data[data['销售金额']!=0]\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 二、数据规整"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n",
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>订单号</th>\n",
       "      <th>销售时间</th>\n",
       "      <th>交货时间</th>\n",
       "      <th>货品交货状况</th>\n",
       "      <th>货品</th>\n",
       "      <th>货品用户反馈</th>\n",
       "      <th>销售区域</th>\n",
       "      <th>数量</th>\n",
       "      <th>销售金额</th>\n",
       "      <th>月份</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>P096311</td>\n",
       "      <td>2016-07-30</td>\n",
       "      <td>2016-9-30</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>2.0</td>\n",
       "      <td>105275.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>P096826</td>\n",
       "      <td>2016-08-30</td>\n",
       "      <td>2016-10-30</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>10.0</td>\n",
       "      <td>11500000.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>P097435</td>\n",
       "      <td>2016-07-30</td>\n",
       "      <td>2016-9-30</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品1</td>\n",
       "      <td>返修</td>\n",
       "      <td>华南</td>\n",
       "      <td>2.0</td>\n",
       "      <td>685877.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>P097446</td>\n",
       "      <td>2016-11-26</td>\n",
       "      <td>2017-1-26</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华北</td>\n",
       "      <td>15.0</td>\n",
       "      <td>12958.0</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>P097446</td>\n",
       "      <td>2016-11-26</td>\n",
       "      <td>2017-1-26</td>\n",
       "      <td>晚交货</td>\n",
       "      <td>货品3</td>\n",
       "      <td>拒货</td>\n",
       "      <td>华北</td>\n",
       "      <td>15.0</td>\n",
       "      <td>3239.0</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1141</th>\n",
       "      <td>P299901</td>\n",
       "      <td>2016-12-15</td>\n",
       "      <td>2017-3-15</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品6</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>马来西亚</td>\n",
       "      <td>2.0</td>\n",
       "      <td>20041.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1142</th>\n",
       "      <td>P302956</td>\n",
       "      <td>2016-12-22</td>\n",
       "      <td>2017-3-22</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>拒货</td>\n",
       "      <td>华东</td>\n",
       "      <td>20.0</td>\n",
       "      <td>7944.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1143</th>\n",
       "      <td>P303801</td>\n",
       "      <td>2016-12-15</td>\n",
       "      <td>2017-3-15</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华东</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19408.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1144</th>\n",
       "      <td>P307276</td>\n",
       "      <td>2016-12-22</td>\n",
       "      <td>2017-3-22</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品6</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>马来西亚</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3218.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1145</th>\n",
       "      <td>P314165</td>\n",
       "      <td>2016-12-20</td>\n",
       "      <td>2017-3-20</td>\n",
       "      <td>按时交货</td>\n",
       "      <td>货品2</td>\n",
       "      <td>质量合格</td>\n",
       "      <td>华东</td>\n",
       "      <td>1.0</td>\n",
       "      <td>172092.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1145 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          订单号       销售时间        交货时间 货品交货状况   货品 货品用户反馈  销售区域    数量  \\\n",
       "0     P096311 2016-07-30   2016-9-30    晚交货  货品3   质量合格    华北   2.0   \n",
       "1     P096826 2016-08-30  2016-10-30   按时交货  货品3   质量合格    华北  10.0   \n",
       "2     P097435 2016-07-30   2016-9-30   按时交货  货品1     返修    华南   2.0   \n",
       "3     P097446 2016-11-26   2017-1-26    晚交货  货品3   质量合格    华北  15.0   \n",
       "4     P097446 2016-11-26   2017-1-26    晚交货  货品3     拒货    华北  15.0   \n",
       "...       ...        ...         ...    ...  ...    ...   ...   ...   \n",
       "1141  P299901 2016-12-15   2017-3-15   按时交货  货品6   质量合格  马来西亚   2.0   \n",
       "1142  P302956 2016-12-22   2017-3-22   按时交货  货品2     拒货    华东  20.0   \n",
       "1143  P303801 2016-12-15   2017-3-15   按时交货  货品2   质量合格    华东   1.0   \n",
       "1144  P307276 2016-12-22   2017-3-22   按时交货  货品6   质量合格  马来西亚   1.0   \n",
       "1145  P314165 2016-12-20   2017-3-20   按时交货  货品2   质量合格    华东   1.0   \n",
       "\n",
       "            销售金额  月份  \n",
       "0       105275.0   7  \n",
       "1     11500000.0   8  \n",
       "2       685877.0   7  \n",
       "3        12958.0  11  \n",
       "4         3239.0  11  \n",
       "...          ...  ..  \n",
       "1141     20041.0  12  \n",
       "1142      7944.0  12  \n",
       "1143     19408.0  12  \n",
       "1144      3218.0  12  \n",
       "1145    172092.0  12  \n",
       "\n",
       "[1145 rows x 10 columns]"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['销售时间'] = pd.to_datetime(data['销售时间'])\n",
    "data['月份'] = data['销售时间'].apply(lambda x:x.month)\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 三、数据分析并可视化\n",
    "1、配送服务是否存在问题\n",
    "#### a.月份维度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>货品交货状况</th>\n",
       "      <th>按时交货</th>\n",
       "      <th>晚交货</th>\n",
       "      <th>按时交货率</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>月份</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>189</td>\n",
       "      <td>13</td>\n",
       "      <td>0.935644</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>218</td>\n",
       "      <td>35</td>\n",
       "      <td>0.861660</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>122</td>\n",
       "      <td>9</td>\n",
       "      <td>0.931298</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>238</td>\n",
       "      <td>31</td>\n",
       "      <td>0.884758</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>101</td>\n",
       "      <td>25</td>\n",
       "      <td>0.801587</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>146</td>\n",
       "      <td>18</td>\n",
       "      <td>0.890244</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "货品交货状况  按时交货  晚交货     按时交货率\n",
       "月份                         \n",
       "7        189   13  0.935644\n",
       "8        218   35  0.861660\n",
       "9        122    9  0.931298\n",
       "10       238   31  0.884758\n",
       "11       101   25  0.801587\n",
       "12       146   18  0.890244"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['货品交货状况'] = data['货品交货状况'].str.strip()\n",
    "data1 = data.groupby(['月份','货品交货状况']).size().unstack()\n",
    "data1['按时交货率'] = data1['按时交货']/(data1['按时交货']+data1['晚交货'])\n",
    "data1\n",
    "#从按时交货率来看，第四季度低于第三季度，猜测可能是气候原因造成"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### b.销售区域维度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "货品交货状况  按时交货  晚交货     按时交货率\n",
      "销售区域                       \n",
      "泰国       183    4  0.978610\n",
      "马来西亚     310   16  0.950920\n",
      "华南        10    1  0.909091\n",
      "华北       226   27  0.893281\n",
      "华东       268   39  0.872964\n",
      "西北        17   44  0.278689\n"
     ]
    }
   ],
   "source": [
    "data1 = data.groupby(['销售区域','货品交货状况']).size().unstack()\n",
    "data1['按时交货率'] = data1['按时交货']/(data1['按时交货']+data1['晚交货'])\n",
    "print(data1.sort_values(by='按时交货率',ascending=False))\n",
    "#西北地区存在突出的延时交货问题，急需解決"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### c.货品维度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "货品交货状况  按时交货  晚交货     按时交货率\n",
      "货品                         \n",
      "货品5      183    4  0.978610\n",
      "货品6      309    7  0.977848\n",
      "货品1       27    2  0.931034\n",
      "货品3      212   26  0.890756\n",
      "货品2      269   48  0.848580\n",
      "货品4       14   44  0.241379\n"
     ]
    }
   ],
   "source": [
    "data1 = data.groupby(['货品','货品交货状况']).size().unstack()\n",
    "data1['按时交货率'] = data1['按时交货']/(data1['按时交货']+data1['晚交货'])\n",
    "print(data1.sort_values(by='按时交货率',ascending=False))\n",
    "#货品4晚交货情况非常严重，其余货品相对交货"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### d.货品和销售区域结合"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "货品交货状况     按时交货   晚交货     按时交货率\n",
      "货品  销售区域                       \n",
      "货品5 泰国    183.0   4.0  0.978610\n",
      "货品6 马来西亚  309.0   7.0  0.977848\n",
      "货品1 华北     14.0   1.0  0.933333\n",
      "    华南     10.0   1.0  0.909091\n",
      "货品3 华北    212.0  26.0  0.890756\n",
      "货品2 华东    268.0  39.0  0.872964\n",
      "货品4 西北     14.0  44.0  0.241379\n",
      "货品2 马来西亚    1.0   9.0  0.100000\n",
      "货品1 西北      3.0   NaN       NaN\n"
     ]
    }
   ],
   "source": [
    "data1 = data.groupby(['货品','销售区域','货品交货状况']).size().unstack()\n",
    "data1['按时交货率'] = data1['按时交货']/(data1['按时交货']+data1['晚交货'])\n",
    "print(data1.sort_values(by='按时交货率',ascending=False))\n",
    "#销售区域：最差在西北地区，货品有1和4，主要是货品4送过较晚导致\n",
    "#货品：最差的货品2，主要送往华东和马来西亚，主要是马来西亚的送货较晚导致。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2、是否存在尚有潜力的销售区域"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### a.月份维度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x269265c2b48>"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEDCAYAAADZUdTgAAAABHN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w0Us/f+AM6h+KK0wUPAZtuHmw5SszHgcUnPAkuAHQ3nid54mOKi5rnyLp5ru/GimZEbMQtJOp/iav+D7DMdM5GiHxHRIv06vBMRER2k6EdEtEiKfkREi8xpOkDEyUrSXmB/pXkxsML21+U5G4A3KGYHDwP7gFHbL9aZNeJE5Uo/Ymr7J9ZxmrSe0/vAXwCSTqW4g2YXcBVwO/ATcGtDeSOmlSv9iKmdKWlbpW0xsL58vAb4xPZRSWuBjbaPSPpe0jLbn9eYNeKEpOhHTO0328snN0jaWv5dQDE9/iVJo8Ax29+Up60H3pR0k+1DNeaNmFaGdyKmdtr/PDdMsdTvIMWM6NMl/V7+MviCYnb0bT1PGDFDmZwVMQVJ+ygWsJtsCbDM9o+SrgGWA08D/wBv275R0iPATtsf1ps4YnoZ3onoQNIiYJftlZX2rdVzbR+WdAXwbdk0H2jbekAxS2R4J6Kzuyluxayaw/FVTAeAAUnzKMbxXy7bz6MY3ok46eRKP6KivMpfATw2qW0+sL08nLh3fz4wD9gEvGp7T/lLYBD4obbAETOQMf2IDiTNtX2k0jZg+1iHc9WivRtilkvRj4hokYzpR0S0SIp+RESLpOhHRLRIin5ERIv8C2e/aqJGv9C7AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "data1 = data.groupby(['月份','货品'])['数量'].sum().unstack()\n",
    "data1.plot(kind='line')\n",
    "# 货品2在10月和12月份，销量猛增，原因猜测有二：1.公司加大营销力度  2.开发了新的市场(后续有结论)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### b.不同区域"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>货品</th>\n",
       "      <th>货品1</th>\n",
       "      <th>货品2</th>\n",
       "      <th>货品3</th>\n",
       "      <th>货品4</th>\n",
       "      <th>货品5</th>\n",
       "      <th>货品6</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>销售区域</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>华东</th>\n",
       "      <td>NaN</td>\n",
       "      <td>53811.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>华北</th>\n",
       "      <td>2827.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9073.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>华南</th>\n",
       "      <td>579.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>泰国</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5733.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>西北</th>\n",
       "      <td>11.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5229.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>马来西亚</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1510.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8401.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "货品       货品1      货品2     货品3     货品4     货品5     货品6\n",
       "销售区域                                                 \n",
       "华东       NaN  53811.0     NaN     NaN     NaN     NaN\n",
       "华北    2827.0      NaN  9073.5     NaN     NaN     NaN\n",
       "华南     579.0      NaN     NaN     NaN     NaN     NaN\n",
       "泰国       NaN      NaN     NaN     NaN  5733.0     NaN\n",
       "西北      11.0      NaN     NaN  5229.0     NaN     NaN\n",
       "马来西亚     NaN   1510.0     NaN     NaN     NaN  8401.0"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1 = data.groupby(['销售区域','货品'])['数量'].sum().unstack()\n",
    "data1\n",
    "# 从销售区域看，每种货品销售区域为1~3个，货品1有三个销售区域，货品2有两个销售区域，其余货品均有1个销售区域"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### c.月份和区域"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "月份  销售区域\n",
       "7   华东        489.0\n",
       "    华北          NaN\n",
       "    华南          NaN\n",
       "    泰国          NaN\n",
       "    西北          NaN\n",
       "    马来西亚        2.0\n",
       "8   华东       1640.0\n",
       "    华北          NaN\n",
       "    华南          NaN\n",
       "    泰国          NaN\n",
       "    西北          NaN\n",
       "    马来西亚     1503.0\n",
       "9   华东       3019.0\n",
       "    华北          NaN\n",
       "    华南          NaN\n",
       "    泰国          NaN\n",
       "    西北          NaN\n",
       "    马来西亚        1.0\n",
       "10  华东      28420.0\n",
       "    华北          NaN\n",
       "    泰国          NaN\n",
       "    西北          NaN\n",
       "    马来西亚        NaN\n",
       "11  华东       2041.0\n",
       "    华北          NaN\n",
       "    华南          NaN\n",
       "    泰国          NaN\n",
       "    西北          NaN\n",
       "    马来西亚        1.0\n",
       "12  华东      18202.0\n",
       "    华北          NaN\n",
       "    华南          NaN\n",
       "    泰国          NaN\n",
       "    西北          NaN\n",
       "    马来西亚        3.0\n",
       "Name: 货品2, dtype: float64"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1 = data.groupby(['月份','销售区域','货品'])['数量'].sum().unstack()\n",
    "data1['货品2']\n",
    "#货品2在10，12月份销量猛增，原因主要发生在原有销售区域（华东）\n",
    "#同样，分析出在7，8，9，11月份销售数量还有很大提升空间，可以适当加大营销力度"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.商品是否存在质量问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>货品用户反馈</th>\n",
       "      <th>拒货</th>\n",
       "      <th>质量合格</th>\n",
       "      <th>返修</th>\n",
       "      <th>拒货率</th>\n",
       "      <th>返修率</th>\n",
       "      <th>合格率</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>货品</th>\n",
       "      <th>销售区域</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>货品3</th>\n",
       "      <th>华北</th>\n",
       "      <td>31.0</td>\n",
       "      <td>188.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0.130252</td>\n",
       "      <td>0.079788</td>\n",
       "      <td>0.789219</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>货品6</th>\n",
       "      <th>马来西亚</th>\n",
       "      <td>56.0</td>\n",
       "      <td>246.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.177215</td>\n",
       "      <td>0.044279</td>\n",
       "      <td>0.777936</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>货品5</th>\n",
       "      <th>泰国</th>\n",
       "      <td>14.0</td>\n",
       "      <td>144.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>0.074866</td>\n",
       "      <td>0.155018</td>\n",
       "      <td>0.769108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>货品2</th>\n",
       "      <th>华东</th>\n",
       "      <td>72.0</td>\n",
       "      <td>184.0</td>\n",
       "      <td>51.0</td>\n",
       "      <td>0.234528</td>\n",
       "      <td>0.165997</td>\n",
       "      <td>0.598568</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">货品1</th>\n",
       "      <th>华南</th>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.454545</td>\n",
       "      <td>0.174603</td>\n",
       "      <td>0.343963</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>西北</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.272727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>华北</th>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.800000</td>\n",
       "      <td>0.189873</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>货品4</th>\n",
       "      <th>西北</th>\n",
       "      <td>NaN</td>\n",
       "      <td>9.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.844828</td>\n",
       "      <td>0.152945</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>货品2</th>\n",
       "      <th>马来西亚</th>\n",
       "      <td>6.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.600000</td>\n",
       "      <td>0.283019</td>\n",
       "      <td>0.091886</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "货品用户反馈      拒货   质量合格    返修       拒货率       返修率       合格率\n",
       "货品  销售区域                                                 \n",
       "货品3 华北    31.0  188.0  19.0  0.130252  0.079788  0.789219\n",
       "货品6 马来西亚  56.0  246.0  14.0  0.177215  0.044279  0.777936\n",
       "货品5 泰国    14.0  144.0  29.0  0.074866  0.155018  0.769108\n",
       "货品2 华东    72.0  184.0  51.0  0.234528  0.165997  0.598568\n",
       "货品1 华南     5.0    4.0   2.0  0.454545  0.174603  0.343963\n",
       "    西北     NaN    1.0   2.0       NaN  0.666667  0.272727\n",
       "    华北     NaN    3.0  12.0       NaN  0.800000  0.189873\n",
       "货品4 西北     NaN    9.0  49.0       NaN  0.844828  0.152945\n",
       "货品2 马来西亚   6.0    1.0   3.0  0.600000  0.283019  0.091886"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['货品用户反馈'] = data['货品用户反馈'].str.strip()  #取出首位空格\n",
    "data1 = data.groupby(['货品','销售区域'])['货品用户反馈'].value_counts().unstack()\n",
    "data1['拒货率'] = data1['拒货'] /data1.sum(axis=1)  #按行进行求和汇总\n",
    "data1['返修率'] = data1['返修'] /data1.sum(axis=1)\n",
    "data1['合格率'] = data1['质量合格'] /data1.sum(axis=1)\n",
    "data1.sort_values(['合格率','返修率','拒货率'],ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 货品3.6.5合格率均较高，返修率比较低，说明质量还可以\n",
    "# 货品1.2.4合格率较低，返修率较高，质量存在一定的问题，需要改善\n",
    "# 货品2在马拉西亚的拒货率最高，同时，在货品2在马拉西亚的按时交货率也非常低。猜测：马来西亚人对送货的时效性要求较高，\n",
    "# 如果达不到，则往往考虑拒货。\n",
    "# 考虑到货品2主要在华东地区销售量大，可以考虑增大在华东的投资，适当较小马来西亚的投入。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
